package com.celeritymq.browsers;

import java.util.Enumeration;
import java.util.Vector;

import javax.jms.JMSException;
import javax.jms.Queue;
import javax.jms.QueueBrowser;

import com.celeritymq.destination.CelerityQueue;

public class CelerityQueueBrowser implements QueueBrowser {
	private Vector<CelerityQueue> queueVector;
	private CelerityQueue queue;
	private String messageSelector;

	public CelerityQueueBrowser(Queue queue, String messageSelector) {
		this.queue = (CelerityQueue) queue;
		this.messageSelector = messageSelector;
	}

	public void addQueue(CelerityQueue queue) {
		queueVector.add(queue);
	}

	@Override
	public void close() throws JMSException {

	}

	@Override
	public Enumeration getEnumeration() throws JMSException {
		return queueVector.elements();
	}

	@Override
	public String getMessageSelector() throws JMSException {
		return messageSelector;
	}

	@Override
	public Queue getQueue() throws JMSException {
		return queue;
	}

}
